package network.盗版qq.qqserver.service;

import java.util.HashMap;

/**
 * @author mubei
 * @date 2021/12/6
 * @description
 * f
 * 该类用于管理 服务器和客户端通信的线程
 */
public class ManageServerClientThreads {

    private static HashMap<String,ServerConnectClientThread> hs = new HashMap<>();

    public  static void addServerConnectClientThread(String userId,ServerConnectClientThread serverConnectClientThread){
        hs.put(userId,serverConnectClientThread);
    }

    public static ServerConnectClientThread getServerConnectClientThread(String userId){
        return hs.get(userId);
    }


    public static String getOnlineUser(){
        String res = "";
        for (String s : hs.keySet()) {
            res=res+s+" ";
        }
        return res;
    }
}
